﻿using System;
using ConsoleAppAbpNext.Modules;
using ConsoleAppAbpNext.Services;
using Volo.Abp;
using Microsoft.Extensions.DependencyInjection;

namespace ConsoleAppAbpNext
{
    class Program
    {
        static void Main(string[] args)
        {
            //using var application = AbpApplicationFactory.Create<PoemConsoleClientMudule>(); // 使用默认注入
            using var application = AbpApplicationFactory.Create<PoemConsoleClientMudule>(options=> options.UseAutofac()); // 使用autofac注入

            application.Initialize();

            var service = application.ServiceProvider.GetService<PoemConsoleService>();
            service.Run();

            Console.WriteLine("any key to stop");
            Console.Read();
        }
    }
}
